<template>
	<view>
		<image :src="image+integralData.img" mode="aspectFill" class="imageurl"></image>
		<view class=" bg-white rowsb align-center padding-right" style="font-size: 26rpx;">
			<view class="  onelineshow padding">
				<view class="onelineshow padding-bottom-sm">{{integralData.title}}</view>
				<text class="text-red ">（{{integralData.integral}}积分）</text>
				<text class="text-red ">已售:{{integralData.virtual_sales}}</text>
			</view>
			<view>
				库存：{{integralData.goods_num}}
			</view>
		</view>
	<!-- 	<view class=" bg-white padding text-center margin-top-sm">
			商家介绍
		</view>
		<view class="text-center padding">
			<rich-text value="" placeholder="" :nodes="integralData.integralCommodityIntro" />
		</view> -->
		<view class="flex-wrap">
			<image src="" mode="widthFix" style="width: 100%;"></image>
		</view>
		<view class="margin text-center padding radius bottomsub" @click="integralDetail">
			支付兑换
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData
	import {
		getIntegralInfo
	} from '../../../common/path.js'
	export default {
		data() {
			return {
				datailid: '',
				integralData: {},
				image:'' 
			}
		},
		onLoad(option) {
			console.log('积分详情=======>', app.integralData);
			this.image = app.image
			this.datailid = option.id
			this.integralData = app.integralData
			this.getIntegralInfo()
		},
		methods: {
			//获取到的积分详情
			getIntegralInfo() {
				let data = {
					id: this.datailid
				}
				this.$axios.axios("POST", getIntegralInfo, data)
					.then(res => {
						console.log('积分详情', res);
						if (res.status == 1) {
							this.integralData = res.data
						}
					})
					.catch(err => {
						console.log(err);
					})
			},
			//下单跳转
			integralDetail(){
				uni.navigateTo({
					url:'./subOrder'
				})
			}
		}
	}
</script>

<style>
	/* 轮播 */
	.imageurl {
		width: 100%;
		height: 350upx !important;
	}

	swiper {
		height: 350upx !important;
	}

	page {
		background-color: #F0F0F0;
	}

	.bottomsub {
		background-color: #FF9800;
		color: #FFFFFF;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
	}
</style>
